{% extends "base.html" %}

{% block content %}
<div class="container-fluid">
    <div class="card">
        <div class="card-header d-flex justify-content-between align-items-center">
            <h5 class="mb-0">
                <i class="fas fa-sliders-h me-2"></i>系统参数设置
            </h5>
            <a href="{{ url_for('settings.settings_index') }}" class="btn btn-secondary">
                <i class="fas fa-arrow-left me-1"></i>返回
            </a>
        </div>
        <div class="card-body">
            <form method="post">
                <div class="mb-4">
                    <h6 class="mb-3">水质阈值设置</h6>
                    <div class="mb-3">
                        <label class="form-label">pH值范围</label>
                        <div class="row">
                            <div class="col-md-6">
                                <input type="number" class="form-control" name="ph_min" 
                                    placeholder="最小值" step="0.1" value="{{ settings.ph_min }}" required>
                            </div>
                            <div class="col-md-6">
                                <input type="number" class="form-control" name="ph_max"
                                    placeholder="最大值" step="0.1" value="{{ settings.ph_max }}" required>
                            </div>
                        </div>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">浊度阈值 (NTU)</label>
                        <input type="number" class="form-control" name="turbidity_threshold"
                            step="0.1" value="{{ settings.turbidity_threshold }}" required>
                    </div>
                </div>

                <div class="mb-4">
                    <h6 class="mb-3">设备监控设置</h6>
                    <div class="mb-3">
                        <label class="form-label">设备离线判定时间（分钟）</label>
                        <input type="number" class="form-control" name="offline_threshold"
                            value="{{ settings.offline_threshold }}" required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">数据采集间隔（秒）</label>
                        <input type="number" class="form-control" name="data_collection_interval"
                            value="{{ settings.data_collection_interval }}" required>
                    </div>
                </div>

                <div class="mb-4">
                    <h6 class="mb-3">维护计划设置</h6>
                    <div class="mb-3">
                        <label class="form-label">常规检查间隔（天）</label>
                        <input type="number" class="form-control" name="routine_inspection_interval"
                            value="{{ settings.routine_inspection_interval }}" required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">全面维护间隔（天）</label>
                        <input type="number" class="form-control" name="full_maintenance_interval"
                            value="{{ settings.full_maintenance_interval }}" required>
                    </div>
                </div>

                <button type="submit" class="btn btn-primary">
                    <i class="fas fa-save me-1"></i>保存设置
                </button>
            </form>
        </div>
    </div>
</div>
{% endblock %} 